package edu.zut.cs.software.estateagent.logon.web.spring.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import edu.zut.cs.software.base.web.spring.controller.GenericController;
import edu.zut.cs.software.estateagent.logon.domain.Authority;
import edu.zut.cs.software.estateagent.logon.service.AuthorityManager;

@CrossOrigin(origins = "*")
@Controller
@RequestMapping("/logon/authority")
public class AuthorityController extends GenericController<Authority, Long, AuthorityManager> {
	AuthorityManager authorityManager;

	@RequestMapping(method = RequestMethod.GET, value = "/index.html")
	public String index() {
		String result = "/authority/index";
		return result;
	}

	@Autowired
	public void setAuthorityManager(AuthorityManager authorityManager) {
		this.authorityManager = authorityManager;
		this.manager = this.authorityManager;
	}
}
